package icu.ikuns.pojo;

/**
 * @Author： Kimariyb
 * @Date：2022/05/14/19:04
 * @Description：
 */
public class Question {
    private String questionId;
    private int questionClass;
    private String questionContent;
    private String questionAnswer;
    private String saveState;

    public void setSaveState(String saveState) {
        QuestionBank questionBank = new QuestionBank();
        int retcode = questionBank.addQuestion(this);
        if (retcode == 2) {
            this.saveState = "已存在同编号项目";
        } else if (retcode == 1) {
            this.saveState = "添加成功";
        }
    }

    public String getSaveState() {
        return saveState;
    }

    public void setCurrentQuestion(int p) {
        QuestionBank qb = new QuestionBank();
        qb.setCurrentPosition(p);
        setQuestionId(qb.getCurrentQuestion().questionId);
        setQuestionClass(qb.getCurrentQuestion().questionClass);
        setQuestionContent(qb.getCurrentQuestion().questionContent);
        setQuestionAnswer(qb.getCurrentQuestion().questionAnswer);
    }

    public Question(String questionId, int questionClass, String questionContent, String questionAnswer) {
        this.questionId = questionId;
        this.questionClass = questionClass;
        this.questionContent = questionContent;
        this.questionAnswer = questionAnswer;
    }

    public String getQuestionId() {
        return questionId;
    }

    public void setQuestionId(String questionId) {
        this.questionId = questionId;
    }

    public int getQuestionClass() {
        return questionClass;
    }

    public void setQuestionClass(int questionClass) {
        this.questionClass = questionClass;
    }

    public String getQuestionContent() {
        return questionContent;
    }

    public void setQuestionContent(String questionContent) {
        this.questionContent = questionContent;
    }

    public String getQuestionAnswer() {
        return questionAnswer;
    }

    public void setQuestionAnswer(String questionAnswer) {
        this.questionAnswer = questionAnswer;
    }

    public Question() {

    }
}
